#include<stdio.h>
int main()
{
   int T;
   scanf("%d",&T);
   for(int i=0;i<T;i++)
   {
   	int N,max=0,sum=0;
   	double average;
   	scanf("%d",&N);
   	int a[N];
   	for(int z=0;z<N;z++)
   	  scanf("%d",&a[z]);
   	for(int z=0;z<N;z++)
   	{
   		if(a[z]>max)
   		{
   			max=a[z];
		}
            sum+=a[z];		
	}
	average=sum/N;
	printf("%d %.2lf",max,average);
	printf("\n");
   }
   return 0;	
} 
